home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 3: Developer Tools / Linux Cubed Series 3 - Developer Tools.iso / devel / debugger / ddd-1.000 / ddd-1 / ddd-1.4b / vsllib / struct.vsl < prev    next >
Encoding:
Text File  |  1995-05-17  |  2.9 KB  |  102 lines

  1. // $Id: struct.vsl,v 1.2 1995/05/17 13:39:55 zeller Exp $
  2. // Draw structograms
  3.  
  4. // Copyright (C) 1993 Technische Universitaet Braunschweig, Germany.
  5. // Written by Andreas Zeller (zeller@ips.cs.tu-bs.de).
  6. // 
  7. // This file is part of the NORA Library.
  8. // 
  9. // The NORA Library is free software; you can redistribute it and/or
  10. // modify it under the terms of the GNU Library General Public
  11. // License as published by the Free Software Foundation; either
  12. // version 2 of the License, or (at your option) any later version.
  13. // 
  14. // The NORA Library is distributed in the hope that it will be useful,
  15. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  17. // See the GNU Library General Public License for more details.
  18. // 
  19. // You should have received a copy of the GNU Library General Public
  20. // License along with the NORA Library -- see the file COPYING.LIB.
  21. // If not, write to the Free Software Foundation, Inc.,
  22. // 675 Mass Ave, Cambridge, MA 02139, USA.
  23. // 
  24. // NORA is an experimental inference-based software development
  25. // environment. Contact nora@ips.cs.tu-bs.de for details.
  26.  
  27. #include "std.vsl"
  28. #include "tab.vsl"
  29. #include "slopes.vsl"
  30.  
  31. // Version
  32. struct_version() = "$Revision: 1.2 $";
  33.  
  34. // Struktogramme
  35.  
  36. // framedListStruct() erzeugt vertikale Liste, durch horizontale Linien getrennt
  37.  
  38. _framedListStruct(stmt) = stmt;
  39. _framedListStruct(stmt, ...) = 
  40.   _framedListStruct(stmt)
  41. | hrule()
  42. | _framedListStruct(...);
  43.  
  44. framedListStruct(...) = 
  45.   vfix(_framedListStruct(...));
  46.  
  47.  
  48. // topLoopStruct() erzeugt abweisende Schleife
  49.  
  50. topLoopStruct(cond, body) =
  51.   cond
  52. | indent(hrule() | vrule() & body);
  53.  
  54.  
  55. // bottomLoopStruct() die andere (wie war noch der Name?)
  56.  
  57. bottomLoopStruct(body, cond) =
  58.   indent(vrule() & body | hrule())
  59. | cond;
  60.  
  61.  
  62. // topBottomLoopStruct() mit Ein- und Ausgangskontrolle
  63.  
  64. topBottomLoopStruct(cond1, body, cond2) =
  65.   cond1
  66. | indent(hrule() | vrule() & body | hrule())
  67. | cond2;
  68.  
  69.  
  70. // fallStruct() erzeugt Kasten mit Haelfte links unten/rechts oben
  71. // riseStruct() erzeugt Kasten mit Haelfte rechts unten/links oben
  72.  
  73. _fallStruct(sw, ne) =
  74.   fall() ^ sw_flush(sw) ^ ne_flush(ne) ^ (sw + ne + rulethickness()) 
  75. | hrule();
  76. fallStruct(sw, ne) = _fallStruct(sw, ne);
  77.  
  78. _riseStruct(nw, se) = 
  79.   rise() ^ nw_flush(nw) ^ se_flush(se) ^ (nw + se + rulethickness())
  80. | hrule();
  81. riseStruct(nw, se) = _riseStruct(nw, se);
  82.  
  83.  
  84. // testStruct() erzeugt Kasten mit Bedingung, True-Label, False-Label,
  85. // True-Koerper und False-Koerper
  86.  
  87. testStruct(cond, leftbody, rightbody, leftlabel, rightlabel) =
  88.  
  89.   let width = hspace(leftlabel | leftbody | rightlabel | rightbody | cond) in
  90.  
  91.   let height = vspace((leftlabel & rightlabel) | cond) in
  92.  
  93.   let ltop = width ^ fall() ^ sw_flush(leftlabel),
  94.       rtop = width ^ rise() ^ se_flush(rightlabel),
  95.       top = ((ltop & rtop) ^ n_flush(cond)) ^ height in
  96.  
  97.   let lbottom = leftbody ^ width,
  98.       rbottom = rightbody ^ width,
  99.       bottom = (lbottom & vrule() & rbottom) in
  100.  
  101.   top | hrule() | bottom;
  102.